using System;
using System.Web.UI.HtmlControls;
using miPics.Common;


public partial class Template_Default : miPics.BasePage.BaseMasterPage
{
	private bool MenuSectionSet = false;
	private bool MenuTaskSet = false;

	protected void Page_Load(object sender, EventArgs e)
	{
		// setup header menu
		if (!this.MenuSectionSet) _Section.Visible = false;
		if (!this.MenuTaskSet) _Task.Visible = false;

		// show/hide logout link
		_Logout.Visible = this.IsLoggedIn;

		// setup RSS meta link title
		_RssLink.Attributes["title"] = Config.Rss.Title;
	}

	#region Menu Setup
	public override void SetMenuSectionGallery(short GalleryID, string GalleryName, string ImageName)
	{
		_Section.Visible = true;
		_Section.InnerText = "> ";

		HtmlAnchor Link = new HtmlAnchor();
		Link.InnerText = GalleryName;
		Link.HRef = "~/Gallery/?id=" + GalleryID.ToString();
		_Section.Controls.Add(Link);

		this.MenuSectionSet = true;

		if (!string.IsNullOrEmpty(ImageName))
		{
			_Task.Visible = true;
			_Task.InnerText = "> " + ImageName;

			this.MenuTaskSet = true;
		}
	}

	public override void SetMenuAdministrationTask(string TaskName)
	{
		_Section.Visible = true;
		_Section.InnerText = "> Administration";
		
		_Task.Visible = true;
		_Task.InnerText = ((!string.IsNullOrEmpty(TaskName)) ? "> " : "") + TaskName;

		this.MenuSectionSet = true;
		this.MenuTaskSet = true;
	}
	#endregion
}